package com.lc.luzhengtang.adapter;

import android.view.ViewGroup;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.lc.luzhengtang.R;
import com.lc.luzhengtang.bean.UnsettledBean;
import com.zcx.helper.scale.ScaleScreenHelperFactory;

import java.util.List;

/**
 * 文 件 名: NewsListAdapter
 * 创 建 人: zhangyu
 * 创建日期: 16/12/24 19:55
 * 邮   箱: yuanchong121@gmail.com
 * 修改时间：
 * 修改备注：
 */
public class UnSettledListAdapter extends BaseQuickAdapter<UnsettledBean.DataBean, BaseViewHolder> {
    public UnSettledListAdapter(List<UnsettledBean.DataBean> data) {

        super(R.layout.item_unsettled, data);
    }


    @Override
    protected void convert(BaseViewHolder helper, UnsettledBean.DataBean item) {
        ScaleScreenHelperFactory.getInstance().loadView((ViewGroup) helper.convertView);
        helper.setText(R.id.text_title, item.getGoods_title());
        helper.setText(R.id.text_yue, item.getReward());

        if (item.getNum()==item.getNumber()){

       //原始的
            helper.setVisible(R.id.btn_wancheng,true);
            helper.setVisible(R.id.text_time, false);
        }else {
     //已完成
            helper.setVisible(R.id.btn_wancheng,false);
            helper.setVisible(R.id.text_time, true);
            helper.setText(R.id.text_time, item.getNum() + "/" + item.getNumber() + "");

        }
        helper.addOnClickListener(R.id.text_time);


    }


}
